package pers.vic.widget.automation.baidu.controller;

import java.time.LocalTime;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import pers.vic.boot.base.model.BaseResponse;
import pers.vic.boot.util.JsonUtil;
import pers.vic.widget.automation.baidu.service.TiebaSignInService;

/**
 * @author Vic.xu
 * @description:
 * @date: 2021/8/27 0027 11:05
 */
@RestController
@RequestMapping(value = "/baidu")
public class BaiduController {

    @Resource
    private TiebaSignInService tiebaSignInService;

    @GetMapping(value = {"/", ""})
    public String index() {
        return LocalTime.now() + "\t welcome to baidu antomation test  index!";
    }

    @GetMapping(value = "/sign")
    public Object sign() {
        BaseResponse<?> baseResponse = tiebaSignInService.signIn();
        return JsonUtil.toJsonPretty(baseResponse);
    }
}
